{---------------------------------------------------------------------
#
#	Apple Macintosh Developer Technical Support
#
#	MultiFinder-Aware Simple TextEdit Sample Application
#
#	OOPTESample
#
#	UTEDocument.p	-	Pascal Source
#
#	Copyright © 1988, 1989 Apple Computer, Inc.
#	All rights reserved.
#
#	Version:		
#					1.00					04/89
#
#	Components:     
#					BuildOOPTESample		April 1, 1989
#					MOOPTESample.p			April 1, 1989
#					OOPTESample.make		April 1, 1989
#					TECommon.h				April 1, 1989
#					TESampleGlue.a			April 1, 1989
#					TESample.r				April 1, 1989
#					UApplication.p			April 1, 1989
#					UApplication.inc1.p		April 1, 1989
#					UDocument.p				April 1, 1989
#					UDocument.inc1.p		April 1, 1989
#					UTEDocument.p			April 1, 1989
#					UTEDocument.inc1.p		April 1, 1989
#					UTESample.p				April 1, 1989
#					UTESample.inc1.p		April 1, 1989
#
---------------------------------------------------------------------}

UNIT UTEDocument;

INTERFACE

USES
	Types, QuickDraw, Controls, Events, Windows, TextEdit, Dialogs,
	Desk, ToolUtils, OSUtils, Scrap, Memory,
	ObjIntf, UDocument, UApplication;

PROCEDURE PascalClikLoop;
FUNCTION GetOldClikLoop:ProcPtr;

TYPE
	TTEDocument = OBJECT(TDocument)
		fDocTE:			TEHandle;		{ Our text, who art in heaven... }
		fDocVScroll:	ControlHandle;	{ Vertical Scrollbar }
		fDocHScroll:	ControlHandle;	{ Horizontal Scrollbar }
		fDocClik:		ProcPtr;		{ Our click loop }

		PROCEDURE TTEDocument.ITEDocument(resID:integer);
		PROCEDURE TTEDocument.Free; OVERRIDE;

		{ methods from TDocument we override }
		PROCEDURE TTEDocument.DoZoom(partCode:integer); OVERRIDE;
		PROCEDURE TTEDocument.DoGrow(theEvent:EventRecord); OVERRIDE;
		PROCEDURE TTEDocument.DoContent(theEvent:EventRecord); OVERRIDE;
		PROCEDURE TTEDocument.DoKeyDown(theEvent:EventRecord); OVERRIDE;
		PROCEDURE TTEDocument.DoActivate(becomingActive:Boolean); OVERRIDE;
		PROCEDURE TTEDocument.DoIdle; OVERRIDE;
		PROCEDURE TTEDocument.DoUpdate; OVERRIDE;
		PROCEDURE TTEDocument.DoCut; OVERRIDE;
		PROCEDURE TTEDocument.DoCopy; OVERRIDE;
		PROCEDURE TTEDocument.DoPaste; OVERRIDE;
		PROCEDURE TTEDocument.DoClear; OVERRIDE;
		FUNCTION TTEDocument.HaveSelection:Boolean; OVERRIDE;
		FUNCTION TTEDocument.CalcIdle:Longint; OVERRIDE;

		{ new public methods }
		PROCEDURE TTEDocument.AdjustScrollValues(mustRedraw:Boolean);
		FUNCTION TTEDocument.GetClikLoop:ProcPtr;
		FUNCTION TTEDocument.GetTEHandle:TEHandle;
		PROCEDURE TTEDocument.GetVisTERgn(rgn:RgnHandle);

		{ methods not intended for use outside of this class }
		PROCEDURE TTEDocument.GetTERect(VAR teRect:Rect);
		PROCEDURE TTEDocument.AdjustTE;
		PROCEDURE TTEDocument.DrawWindow;
		PROCEDURE TTEDocument.AdjustViewRect;
		PROCEDURE TTEDocument.ResizeWindow;
		PROCEDURE TTEDocument.AdjustHV(isVert, mustRedraw:Boolean);
		PROCEDURE TTEDocument.AdjustScrollSizes;
		PROCEDURE TTEDocument.AdjustScrollbars(needsResize:Boolean);
	END;

VAR
	gApplication: TApplication;

IMPLEMENTATION

{$I UTEDocument.inc1.p}

END.